function g(id) {
	return document.getElementById(id);
}
/**
 * 修改个人信息页面js
 */
	function checkInfo() {
		var address = g("userAddress").value;
		var birthday = g("birthday").value;
		var phone = g("userPhone").value;
		var email = g("userEmail").value;
		var officetTel = g("userOfficephone").value;
		var userName = g("userName").value;
		var userPassword = g("userPassword").value;
		var department = g("department").value;
		var checkEmail = /^([\w_\.\-])+@\w+(\.[a-zA-Z]{2,3}){1,2}$/;
		if(userName.length==0){
			g("nameError").innerHTML = "姓名不能为空";
			return false;
		}else{
			g("nameError").innerHTML = "";
		}
		if(userPassword.length==0){
			g("passwordError").innerHTML = "密码不能为空";
			return false;
		}else{
			g("passwordError").innerHTML = "";
		}
		if(department.length==0){
			g("departmentError").innerHTML = "请选择部门";
			return false;
		}else{
			g("departmentError").innerHTML = "";
		}
		if(department.length!=0){
			var position = g("positions").value;
			if(position.length==0){
				g("positionError").innerHTML = "请选择职位";
				return false;
			}else{
				g("positionError").innerHTML = "";
			}
		}
		if(birthday.length==0){
			g("birthdayError").innerHTML = "出生日期不能为空";
			return false;
		}else{
			g("birthdayError").innerHTML = "";
		}
		if(email.length==0){
			g("emailError").innerHTML = "电子邮箱不能为空";
			return false;
		}else if(!checkEmail.test(email)){
			g("emailError").innerHTML = "邮箱格式不符";
			return false;
		}else{
			g("emailError").innerHTML = "";
		}
		if(officetTel.length==0||officetTel==""){
			g("officephoneError").innerHTML = "办公电话不能为空";
			return false;
		}else{
			g("officephoneError").innerHTML = "";
		}
		if(isNaN(phone) || phone.length != 11 || phone == ""||phone.length==0){
			g("phoneError").innerHTML = "手机号码不能为空,且必须为11数字";
			return false;
		}else{
			g("phoneError").innerHTML = "";
		}
		if(address.length==0){
			g("addressError").innerHTML = "家庭地址不能为空";
			return false;
		}else{
			g("addressError").innerHTML = "";
			return true;
		}
  	}
	
	
	function checkLeaveInfo(){
		var startDate = g("d5221").value;		
		var endDate = g("d5222").value;		
		var reason = g("reason").value;
		if(startDate.length==0||startDate==""){
			g("dateError").innerHTML = "开始日期不能为空";
			return false;
		}else{
			g("dateError").innerHTML = "";
		}
		if(endDate.length==0||endDate==""){
			g("dateError").innerHTML = "结束日期不能为空";
			return false;
		}else{
			g("dateError").innerHTML = "";
		}
		if(reason.length==0||reason==""){
			g("reasonError").innerHTML = "请假理由不能为空";
			return false;
		}else{
			g("reasonError").innerHTML = "";
			return true;
		}
	}